package init

import (
	"fmt"
	"go.uber.org/zap"
	"mouth-project/config"
	"mouth-project/model/mysql"
	"mouth-project/model/redis"
)

func init() {
	config.InitConfig()
	mysql.InitMysql()
	redis.InitRedis()
	Zap()
}

//zap日志库

func Zap() {
	ZapConfig := zap.NewDevelopmentConfig()
	ZapConfig.OutputPaths = []string{
		"\\project\\src\\mouth-project/mouth.log",
		"stdout",
	}
	logger, err := ZapConfig.Build()
	if err != nil {
		fmt.Println("错误信息: :", err)
		return
	}
	zap.ReplaceGlobals(logger)
}
